package com.jackstraw.jack_base.rules.service;


import com.jackstraw.jack_base.rules.entity.bo.SceneActuatorBo;
import com.jackstraw.jack_base.rules.entity.dto.RuleExcuteDto;
import com.jackstraw.jack_base.rules.entity.dto.RuleExecutionObject;
import org.kie.api.runtime.KieSession;

public interface RuleBizService {

    /**
     * 执行方法
     *
     * @param ruleExcuteDto
     * @return
     */
    RuleExcuteDto excute(RuleExcuteDto ruleExcuteDto);


    /**
     * 通过sceneName获取场景执行器
     *
     * @param sceneName
     * @return
     */
    RuleExcuteService ruleExcuteService(String sceneName);

    /**
     * 通过规则组ID获取KieSession
     *
     * @param ruleGroupId 规则组ID
     * @return
     */
    KieSession kieSession(Long ruleGroupId);

    /**
     * 通过场景配置解析场景执行器
     *
     * @param sceneActuatorBo
     */
    void ruleExcuteService(SceneActuatorBo sceneActuatorBo);

    /**
     * 执行规则组
     * @param ruleGroupId
     * @param ruleExecutionObject
     * @return
     */
    RuleExecutionObject executeGroup(Long ruleGroupId, RuleExecutionObject ruleExecutionObject);

    /**
     * 项目初始化
     */
    void init();
}
